package net.hn.hnms.biz.energy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import net.hn.hnms.biz.energy.domain.WaterSupplyCompany;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface WaterSupplyCompanyServiceMapper extends BaseMapper<WaterSupplyCompany> {
    @Update("<script>" +
            " update  water_supply_company set  del_flag = '1' " +
            " where water_supply_company_id in" +
            " <foreach collection=\"list\" item=\"value\" separator=\",\" open=\"(\" close=\")\">\n" +
            "#{value}" +
            "</foreach>" +
            "</script>")
    void updateDeleteByIds(@Param("list") List<String> list);

    @Select("<script>select count(1) from water_supply_company where mine_code=#{mineCode} and del_flag='0'</script>")
    int getWaterSupplyCompanyByMineCode(@Param("mineCode") String mineCode);

}
